Optimal. Leaf size=39 \[ \frac {x}{b}-\frac {\sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{\sqrt {a} b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3270, 400, 212,
214} \begin {gather*} \frac {x}{b}-\frac {\sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{\sqrt {a} b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 214
Rule 400
Rule 3270
Rubi steps
\begin {align*} \int \frac {\sinh ^2(x)}{a+b \cosh ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a-(a+b) x^2\right )} \, dx,x,\coth (x)\right )\\ &=\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\coth (x)\right )}{b}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{a+(-a-b) x^2} \, dx,x,\coth (x)\right )}{b}\\ &=\frac {x}{b}-\frac {\sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{\sqrt {a} b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 36, normalized size = 0.92 \begin {gather*} \frac {x-\frac {\sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{\sqrt {a}}}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(109\) vs.
\(2(31)=62\).
time = 0.68, size = 110, normalized size = 2.82
method | result | size |
risch | \(\frac {x}{b}+\frac {\sqrt {a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 x}+\frac {2 \sqrt {a \left (a +b \right )}+2 a +b}{b}\right )}{2 a b}-\frac {\sqrt {a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 x}-\frac {2 \sqrt {a \left (a +b \right )}-2 a -b}{b}\right )}{2 a b}\) | \(88\) |
default | \(\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{b}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b}+\frac {2 \left (a +b \right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}\right )}{b}\) | \(110\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 120 vs.
\(2 (31) = 62\).
time = 0.48, size = 120, normalized size = 3.08 \begin {gather*} -\frac {{\left (2 \, a + b\right )} \log \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{4 \, \sqrt {{\left (a + b\right )} a} b} + \frac {\log \left (\frac {b e^{\left (-2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (-2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{4 \, \sqrt {{\left (a + b\right )} a}} + \frac {x}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.41, size = 300, normalized size = 7.69 \begin {gather*} \left [\frac {\sqrt {\frac {a + b}{a}} \log \left (\frac {b^{2} \cosh \left (x\right )^{4} + 4 \, b^{2} \cosh \left (x\right ) \sinh \left (x\right )^{3} + b^{2} \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (x\right )^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + 8 \, a^{2} + 8 \, a b + b^{2} + 4 \, {\left (b^{2} \cosh \left (x\right )^{3} + {\left (2 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 4 \, {\left (a b \cosh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) \sinh \left (x\right ) + a b \sinh \left (x\right )^{2} + 2 \, a^{2} + a b\right )} \sqrt {\frac {a + b}{a}}}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) + 2 \, x}{2 \, b}, -\frac {\sqrt {-\frac {a + b}{a}} \arctan \left (\frac {{\left (b \cosh \left (x\right )^{2} + 2 \, b \cosh \left (x\right ) \sinh \left (x\right ) + b \sinh \left (x\right )^{2} + 2 \, a + b\right )} \sqrt {-\frac {a + b}{a}}}{2 \, {\left (a + b\right )}}\right ) - x}{b}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 52, normalized size = 1.33 \begin {gather*} -\frac {{\left (a + b\right )} \arctan \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt {-a^{2} - a b}}\right )}{\sqrt {-a^{2} - a b} b} + \frac {x}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.22, size = 79, normalized size = 2.03 \begin {gather*} \frac {x}{b}+\frac {\mathrm {atan}\left (\frac {\sqrt {-a\,b^2}}{2\,a\,\sqrt {a+b}}+\frac {\sqrt {-a\,b^2}}{b\,\sqrt {a+b}}+\frac {{\mathrm {e}}^{2\,x}\,\sqrt {-a\,b^2}}{2\,a\,\sqrt {a+b}}\right )\,\sqrt {a+b}}{\sqrt {-a\,b^2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________